/*
 * @FilePath: \plugWeb\src\main.js
 * @Version: 2.0
 * @LastEditors: lhl
 * @LastEditTime: 2022-01-07 15:32:50
 * @Description:
 */
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import '@/assets/css/common.css'
import './units/Antd'
import { initTheme } from './units/variable'
import 'quill/dist/quill.snow.css'
import VueI18n from 'vue-i18n'
import CommonTitle from './components/CommonTitle.vue'
import _ from 'lodash'
import componentsInstall from './components/MonacoEditor/install'

Vue.use(componentsInstall)
Vue.use(CommonTitle)
// 中英文切换引入
Vue.use(VueI18n)
const i18n = new VueI18n({
  locale: sessionStorage.getItem('languageSet') || 'zh', // 从localStorage里获取用户中英文选择，没有则默认中文
  messages: {
    zh: require('./units/language/zh'),
    en: require('./units/language/en')
  }
})
// 中英文切换引入终
// 初始化主题
initTheme(sessionStorage.theme || 'light', sessionStorage.daynight === 'true')
Vue.prototype.$initTheme = initTheme
Vue.prototype._ = _
// 初始化主题终
Vue.config.productionTip = false
new Vue({
  router,
  store,
  i18n, // 把 i18n 挂载到 vue 根实例上
  render: (h) => h(App)
}).$mount('#app')
